﻿#define _CRT_SECURE_NO_WARNINGS
#include<string.h>                         
#include<stdio.h>

//1 2 3

//4 5 6

//7 8 9

void remove_2(char *left,char*right)
{
    while (left < right)
    {
        char temp = *left;
        *left = *right;
        *right = temp;
        left++;
        right--;
    }
   
}


int remove_1(char arr1[], char arr2[])
{
    int len1 = strlen(arr1);
    int len2 = strlen(arr2);
    if (len1 != len2)
        return 0;
    int i = 0;
    for (i = 0; i < len1; i++)
    {
        remove_2(arr1,  arr1 + i - 1);      // 反转前i个字符
        remove_2(arr1 + i, arr1 + len1 - 1); // 反转剩余字符
        remove_2(arr1, arr1 + len1 - 1);     // 整体反转
        if (strcmp(arr1, arr2) == 0)
        {
            return 1;
        }
                
    }

}

    int main()
    {
  
        char arr1[] = "ABCDE";
        char arr2[] = "DEABC";
        int ret = remove_1(arr1, arr2);
        if (ret == 1)
        {
            printf("yes");

        }
        else
            printf("no");
        return 0;
     }
    
                                  

